package com.gzhryc.shared_device.cdb.core.protocol.v1.msg;

import com.gzhryc.common.IDTools;
import com.gzhryc.common.secruity.CRC16;

import java.io.Serializable;

/**
 * 重启
 */
public class CSRequest implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private String cmd = "CS";
	private String messageId;
	
	public CSRequest() {
		this.messageId = IDTools.getTimestampSecondID();
	}
	
	public String getData() {
		String data = cmd+","+messageId+",RECONNECT,0,0";
		return data;
	}

	public String getMessage() {
		String data = getData();
		String crc16 = CRC16.get((data+","+ BaseMessage.MESSAGE_KEY).getBytes());
		return "{"+data+","+crc16+"}";
	}

}
